import http from '.'
/**
 * 查询用户账户
 */
export function queryUserAccount(params) {
  return http.get(
    'api/v1/account/userAccount/query?' + Form(params).queryString()
  )
}
/**
 *  查询账户详情
 * @param {*} rowId
 */
export function selectUserAccountDetail(rowId) {
  return http.get(
    'api/v1/account/userAccount/selectUserAccountDetail?rowId=' + rowId
  )
}
/**
 * 修改账户
 * @param {*} params
 */
export function editUserAccount(params) {
  return http.post(
    'api/v1/account/userAccount/edit?' + Form(params).queryString()
  )
}
/**
 * 用户账户明细
 * @param {*} params
 */
export function selectIntrAcctBookDetail(params) {
  return http.get(
    'api/v1/account/accountBook/selectIntrAcctBookDetail?' +
      Form(params).queryString()
  )
}
/**
 * 查询用户账户充值单
 */
export function queryUserAccountRechargeOrder(params) {
  return http.get(
    'api/v1/account/userAccountRechargeOrder/query?' +
      Form(params).queryString()
  )
}
/**
 * 查询账户充值订单详情
 * @param {*} rowId
 */
export function queryUserAccountRechargeOrderDetail(rowId) {
  return http.get(
    'api/v1/account/userAccountRechargeOrder/selectUserAccountRechargeOrderDetail?rowId=' +
      rowId
  )
}
/**
 * 查询用户账户提现单
 */
export function queryUserAccountWithDrawCashApply(params) {
  return http.get(
    'api/v1/account/userAccountWithdrawCashApply/query?' +
      Form(params).queryString()
  )
}
/**
 * 查询账户提现申请详情
 * @param {*} rowId
 */
export function queryUserAccountWithDrawCashApplyDetail(rowId) {
  return http.get(
    'api/v1/account/userAccountWithdrawCashApply/selectUserAccountWithdrawCashApplyDetail?rowId=' +
      rowId
  )
}
/**
 * 审核拒绝
 * @param {*} params
 */
export function rejectAccountWithDrawCashApply(params) {
  return http.post(
    'api/v1/account/userAccountWithdrawCashApply/rejectAccountWithdrawCashApply?' +
      Form(params).queryString()
  )
}
/**
 * 审核通过
 * @param {*} rowId
 */
export function approveAccountWithDrawCashApply(rowId) {
  return http.post(
    'api/v1/account/userAccountWithdrawCashApply/approveAccountWithdrawCashApply?rowId=' +
      rowId
  )
}
/**
 * 查询用户账户交易
 */
export function queryAccountBook(params) {
  return http.get(
    'api/v1/account/accountBook/query?' + Form(params).queryString()
  )
}
/**
 * 查询用户账户明细详情
 * @param {*} rowId
 */
export function queryIntrAcctBookDetailByRowId(rowId) {
  return http.get(
    'api/v1/account/accountBook/selectIntrAcctBookDetailByRowId?rowId=' + rowId
  )
}

/**
 * 查询提现银行信息(分页)
 * @param {*} params
 */
export function queryWithdrawBank(params) {
  return http.get('api/v1/account/bank/query?' + Form(params).queryString())
}

/**
 * 删除提现银行信息
 * @param {*} rowId
 */
export function deleteWithdrawBank(rowId) {
  return http.post('api/v1/account/bank/delete?rowId=' + rowId)
}

/**
 * 新增提现银行信息
 * @param {*} params
 */
export function addWithdrawBank(params) {
  return http.post('api/v1/account/bank/add?' + Form(params).queryString())
}

/**
 * 修改提现银行信息
 * @param {*} params
 */
export function editWithdrawBank(params) {
  return http.post('api/v1/account/bank/edit?' + Form(params).queryString())
}

/**
 * 查询提现方式列表
 */
export function queryWithdrawMode(params) {
  return http.get(
    'api/v1/account/withdrawMode/query?' + Form(params).queryString()
  )
}

/**
 * 删除提现方式
 */
export function deleteWithdrawMode(rowId) {
  return http.post('api/v1/account/withdrawMode/delete?rowId=' + rowId)
}
/**
 * 新增、修改提现方式
 */
export function addOrEditWithdrawMode(params) {
  return http.post(
    `api/v1/account/withdrawMode/${params.rowId ? 'edit' : 'add'}`,
    Form(params)
  )
}

export function detailWithdrawMode(rowId) {
  return http.get('api/v1/account/withdrawMode/detail?rowId=' + rowId)
}
